# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.PlayCustomApp.V1.Model.CustomApp do
  @moduledoc """
  This resource represents a custom app.

  ## Attributes

  *   `languageCode` (*type:* `String.t`, *default:* `nil`) - Default listing language in BCP 47 format.
  *   `organizations` (*type:* `list(GoogleApi.PlayCustomApp.V1.Model.Organization.t)`, *default:* `nil`) - Organizations to which the custom app should be made available. If the request contains any organizations, then the app will be restricted to only these organizations. To support the organization linked to the developer account, the organization ID should be provided explicitly together with other organizations. If no organizations are provided, then the app is only available to the organization linked to the developer account.
  *   `packageName` (*type:* `String.t`, *default:* `nil`) - Output only. Package name of the created Android app. Only present in the API response.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title for the Android app.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :languageCode => String.t() | nil,
          :organizations => list(GoogleApi.PlayCustomApp.V1.Model.Organization.t()) | nil,
          :packageName => String.t() | nil,
          :title => String.t() | nil
        }

  field(:languageCode)
  field(:organizations, as: GoogleApi.PlayCustomApp.V1.Model.Organization, type: :list)
  field(:packageName)
  field(:title)
end

defimpl Poison.Decoder, for: GoogleApi.PlayCustomApp.V1.Model.CustomApp do
  def decode(value, options) do
    GoogleApi.PlayCustomApp.V1.Model.CustomApp.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.PlayCustomApp.V1.Model.CustomApp do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
